home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 316 / install / makefile.gnu < prev    next >
Encoding:
Makefile  |  1988-10-20  |  11.8 KB  |  364 lines

  1. # Makefile for GNU C compiler.
  2. #   Copyright (C) 1987 Free Software Foundation, Inc.
  3.  
  4. #This file is part of GNU CC.
  5.  
  6. #GNU CC is distributed in the hope that it will be useful,
  7. #but WITHOUT ANY WARRANTY.  No author or distributor
  8. #accepts responsibility to anyone for the consequences of using it
  9. #or for whether it serves any particular purpose or works at all,
  10. #unless he says so in writing.  Refer to the GNU CC General Public
  11. #License for full details.
  12.  
  13. #Everyone is granted permission to copy, modify and redistribute
  14. #GNU CC, but only under the conditions described in the
  15. #GNU CC General Public License.   A copy of this license is
  16. #supposed to have been given to you along with GNU CC so you
  17. #can know your rights and responsibilities.  It should be in a
  18. #file named COPYING.  Among other things, the copyright notice
  19. #and this notice must be preserved on all copies.
  20.  
  21.  
  22. CFLAGS = -g
  23. CC = cc
  24. # OLDCC should not be the GNU C compiler.
  25. OLDCC = cc
  26. BISON = bison
  27. AR = ar
  28. SHELL = /bin/sh
  29.  
  30. bindir = /usr/local
  31. libdir = /usr/local/lib
  32.  
  33. # These are what you would need on HPUX:
  34. # CFLAGS = -Wc,-Ns2000 -Wc,-Ne700
  35. # -g is desirable in CFLAGS, but a compiler bug in HPUX version 5
  36. # bites whenever tree.def, rtl.def or machmode.def is included
  37. # (ie., on every source file).
  38. # CCLIBFLAGS = -Wc,-Ns2000 -Wc,-Ne700
  39. # For CCLIBFLAGS you might want to specify the switch that
  40. # forces only 68000 instructions to be used.
  41.  
  42. # If you are making gcc for the first time, and if you are compiling it with
  43. # a non-gcc compiler, and if your system doesn't have a working alloca() in any
  44. # of the standard libraries (as is true for HP/UX), then get alloca.c from
  45. # GNU Emacs and un-comment the following line:
  46. # CLIB = alloca.o
  47.  
  48. # If your system has alloca() in /lib/libPW.a, un-comment the following line:
  49. # CLIB= -lc -lPW
  50.  
  51. # For System V based systems, you will also have to comment out the `ranlib'
  52. # command below.
  53.  
  54. # If you are running GCC on an Apollo, you will need this:
  55. # CFLAGS = -g -O -M 3000 -U__STDC__ -DSHORT_ENUM_BUG
  56.  
  57. # How to link with obstack
  58. OBSTACK=obstack.o
  59. # Dependency on obstack
  60. OBSTACK1=obstack.o
  61.  
  62. LIBS = $(OBSTACK) $(CLIB)
  63. DIR = ../gcc
  64.  
  65. OBJS = toplev.o version.o parse.tab.o tree.o print-tree.o \
  66.  decl.o typecheck.o stor-layout.o fold-const.o \
  67.  rtl.o expr.o stmt.o expmed.o explow.o optabs.o varasm.o \
  68.  symout.o dbxout.o sdbout.o emit-rtl.o insn-emit.o \
  69.  integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \
  70.  regclass.o local-alloc.o global-alloc.o reload.o reload1.o insn-peep.o \
  71.  final.o recog.o insn-recog.o insn-extract.o insn-output.o
  72.  
  73. # Files to be copied away after each stage in building.
  74. STAGE_GCC=gcc
  75. STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
  76.  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
  77.  genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
  78.  cc1 cpp cccp
  79.  
  80. # Members of gnulib.
  81. LIBFUNCS = _eprintf \
  82.    _umulsi3 _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
  83.    _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
  84.    _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 _cmpdf2 \
  85.    _fixunsdfsi _fixunsdfdi _fixdfsi _fixdfdi \
  86.    _floatsidf _floatdidf _truncdfsf2 _extendsfdf2 \
  87.    _addsf3 _negsf2 _subsf3 _cmpsf2 _mulsf3 _divsf3
  88.  
  89. # If you want to recompile everything, just do rm *.o.
  90. # CONFIG_H = config.h tm.h
  91. CONFIG_H =
  92. RTL_H = rtl.h rtl.def machmode.def
  93. TREE_H = tree.h tree.def machmode.def
  94.  
  95. all: gnulib gcc cc1 cpp
  96.  
  97. doc: cpp.info internals
  98.  
  99. compilations: ${OBJS}
  100.  
  101. gcc: gcc.o version.o $(OBSTACK1)
  102.     $(CC) $(CFLAGS) -o gccnew gcc.o version.o $(LIBS)
  103. # Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
  104.     mv gccnew gcc
  105.  
  106. gcc.o: gcc.c $(CONFIG_H)
  107.     $(CC) $(CFLAGS) -c -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-\" gcc.c
  108.  
  109. cc1: $(OBJS) $(OBSTACK1)
  110.     $(CC) $(CFLAGS) -o cc1 $(OBJS) $(LIBS)
  111.  
  112. #Library of arithmetic subroutines
  113. # Don't compile this with gcc!
  114. gnulib: gnulib.c
  115.     -mkdir libtemp
  116.     cd libtemp; \
  117.     rm -f gnulib; \
  118.     for name in $(LIBFUNCS); \
  119.     do \
  120.       echo $${name}; \
  121.       rm -f $${name}.c; \
  122.       ln ../gnulib.c $${name}.c; \
  123.       $(OLDCC) $(CCLIBFLAGS) -O -I.. -c -DL$${name} $${name}.c; \
  124.       $(AR) qc gnulib $${name}.o; \
  125.     done
  126.     mv libtemp/gnulib .
  127.     rm -rf libtemp
  128.     if [ -f /usr/bin/ranlib ] ; then  ranlib gnulib ;fi
  129. # On HPUX, if you are working with the GNU assembler and linker,
  130. # the previous line must be replaced with
  131. # No change is needed here if you are using the HPUX assembler and linker.
  132. #    mv gnulib gnulib-hp
  133. #    hpxt gnulib-hp gnulib
  134.  
  135. decl.o : decl.c $(CONFIG_H) $(TREE_H) flags.h c-tree.h parse.h
  136. typecheck.o : typecheck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
  137. tree.o : tree.c $(CONFIG_H) $(TREE_H)
  138. print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
  139. stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H)
  140. fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H)
  141. toplev.o : toplev.c $(CONFIG_H) $(TREE_H) flags.h
  142.  
  143. parse.tab.o : parse.tab.c $(CONFIG_H) $(TREE_H) parse.h c-tree.h flags.h
  144.  
  145. parse.tab.c : parse.y
  146.     $(BISON) -v parse.y
  147.  
  148. rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
  149.  
  150. varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h expr.h
  151. stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
  152.    insn-flags.h expr.h insn-config.h regs.h 
  153. expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
  154.    insn-flags.h insn-codes.h expr.h insn-config.h recog.h
  155. expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
  156.    insn-flags.h insn-codes.h expr.h insn-config.h recog.h
  157. explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h
  158. optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
  159.    insn-flags.h insn-codes.h expr.h insn-config.h recog.h
  160. symout.o : symout.c $(CONFIG_H) $(TREE_H) $(RTL_H) symseg.h gdbfiles.h
  161. dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H)
  162. sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h
  163.  
  164. emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h
  165.  
  166. integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-flags.h
  167.  
  168. jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h regs.h
  169. stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h
  170.  
  171. cse.o : cse.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h hard-reg-set.h
  172. loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h recog.h
  173. flow.o : flow.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h
  174. combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h  \
  175.    insn-config.h regs.h basic-block.h recog.h
  176. regclass.o : regclass.c $(CONFIG_H) $(RTL_H) flags.h regs.h \
  177.    insn-config.h recog.h hard-reg-set.h
  178. local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h \
  179.    insn-config.h recog.h hard-reg-set.h
  180. global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h  \
  181.    basic-block.h regs.h hard-reg-set.h insn-config.h
  182.  
  183. reload.o : reload.c $(CONFIG_H) $(RTL_H)  \
  184.    reload.h recog.h hard-reg-set.h insn-config.h regs.h
  185. reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h  \
  186.    reload.h regs.h hard-reg-set.h insn-config.h basic-block.h
  187. final.o : final.c $(CONFIG_H) $(RTL_H) regs.h recog.h conditions.h gdbfiles.h
  188. recog.o : recog.c $(CONFIG_H) $(RTL_H)  \
  189.    regs.h recog.h hard-reg-set.h insn-config.h
  190.  
  191. # Now the source files that are generated from the machine description.
  192.  
  193. .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
  194.   insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c
  195.  
  196. insn-config.h : md genconfig
  197.     ./genconfig md > tmp-insn-config.h
  198.     ./move-if-change tmp-insn-config.h insn-config.h
  199.  
  200. insn-flags.h : md genflags
  201.     ./genflags md > tmp-insn-flags.h
  202.     ./move-if-change tmp-insn-flags.h insn-flags.h
  203.  
  204. insn-codes.h : md gencodes
  205.     ./gencodes md > tmp-insn-codes.h
  206.     ./move-if-change tmp-insn-codes.h insn-codes.h
  207.  
  208. insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h insn-config.h
  209.     $(CC) $(CFLAGS) -c insn-emit.c
  210.  
  211. insn-emit.c : md genemit
  212.     ./genemit md > tmp-insn-emit.c
  213.     ./move-if-change tmp-insn-emit.c insn-emit.c
  214.  
  215. insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h
  216.     $(CC) $(CFLAGS) -c insn-recog.c
  217.  
  218. insn-recog.c : md genrecog
  219.     ./genrecog md > tmp-insn-recog.c
  220.     ./move-if-change tmp-insn-recog.c insn-recog.c
  221.  
  222. insn-extract.o : insn-extract.c $(RTL_H)
  223.     $(CC) $(CFLAGS) -c insn-extract.c
  224.  
  225. insn-extract.c : md genextract
  226.     ./genextract md > tmp-insn-extract.c
  227.     ./move-if-change tmp-insn-extract.c insn-extract.c
  228.  
  229. insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h
  230.     $(CC) $(CFLAGS) -c insn-peep.c
  231.  
  232. insn-peep.c : md genpeep
  233.     ./genpeep md > tmp-insn-peep.c
  234.     ./move-if-change tmp-insn-peep.c insn-peep.c
  235.  
  236. insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h insn-flags.h conditions.h output.h aux-output.c
  237.     $(CC) $(CFLAGS) -c insn-output.c
  238.  
  239. insn-output.c : md genoutput
  240.     ./genoutput md > tmp-insn-output.c
  241.     ./move-if-change tmp-insn-output.c insn-output.c
  242.  
  243. # Now the programs that generate those files.
  244.  
  245. genconfig : genconfig.o rtl.o $(OBSTACK1)
  246.     $(CC) $(CFLAGS) -o genconfig genconfig.o rtl.o $(LIBS)
  247.  
  248. genconfig.o : genconfig.c $(RTL_H)
  249.     $(CC) $(CFLAGS) -c genconfig.c
  250.  
  251. genflags : genflags.o rtl.o $(OBSTACK1)
  252.     $(CC) $(CFLAGS) -o genflags genflags.o rtl.o $(LIBS)
  253.  
  254. genflags.o : genflags.c $(RTL_H)
  255.     $(CC) $(CFLAGS) -c genflags.c
  256.  
  257. gencodes : gencodes.o rtl.o $(OBSTACK1)
  258.     $(CC) $(CFLAGS) -o gencodes gencodes.o rtl.o $(LIBS)
  259.  
  260. gencodes.o : gencodes.c $(RTL_H)
  261.     $(CC) $(CFLAGS) -c gencodes.c
  262.  
  263. genemit : genemit.o rtl.o $(OBSTACK1)
  264.     $(CC) $(CFLAGS) -o genemit genemit.o rtl.o $(LIBS)
  265.  
  266. genemit.o : genemit.c $(RTL_H)
  267.     $(CC) $(CFLAGS) -c genemit.c
  268.  
  269. genrecog : genrecog.o rtl.o $(OBSTACK1)
  270.     $(CC) $(CFLAGS) -o genrecog genrecog.o rtl.o $(LIBS)
  271.  
  272. genrecog.o : genrecog.c $(RTL_H)
  273.     $(CC) $(CFLAGS) -c genrecog.c
  274.  
  275. genextract : genextract.o rtl.o $(OBSTACK1)
  276.     $(CC) $(CFLAGS) -o genextract genextract.o rtl.o $(LIBS)
  277.  
  278. genextract.o : genextract.c $(RTL_H)
  279.     $(CC) $(CFLAGS) -c genextract.c
  280.  
  281. genpeep : genpeep.o rtl.o $(OBSTACK1)
  282.     $(CC) $(CFLAGS) -o genpeep genpeep.o rtl.o $(LIBS)
  283.  
  284. genpeep.o : genpeep.c $(RTL_H)
  285.     $(CC) $(CFLAGS) -c genpeep.c
  286.  
  287. genoutput : genoutput.o rtl.o $(OBSTACK1)
  288.     $(CC) $(CFLAGS) -o genoutput genoutput.o rtl.o $(LIBS)
  289.  
  290. genoutput.o : genoutput.c $(RTL_H)
  291.     $(CC) $(CFLAGS) -c genoutput.c
  292.  
  293. # Making the preprocessor
  294. cpp: cccp
  295.     -rm -f cpp
  296.     ln cccp cpp
  297. cccp: cccp.o cexp.o version.o
  298.     $(CC) $(CFLAGS) -DGCC_INCLUDE_DIR=\"$(libdir)/gcc-include\" \
  299.           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" -c cccp.c
  300. cexp.o: cexp.c
  301. cexp.c: cexp.y
  302.     $(BISON) cexp.y
  303.     mv cexp.tab.c cexp.c
  304. cccp.o: cccp.c
  305.  
  306. cpp.info: cpp.texinfo
  307.     makeinfo $<
  308.  
  309. internals: internals.texinfo
  310.     makeinfo $<
  311.  
  312. # gnulib is not deleted because deleting it would be inconvenient
  313. # for most uses of this target.
  314. clean:
  315.     -rm -f $(STAGESTUFF) $(STAGE_GCC)
  316.     -rm -f *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
  317.     -rm -f core
  318.  
  319. # Copy the files into directories where they will be run.
  320. install: all
  321.     install cc1 $(libdir)/gcc-cc1
  322.     install -c -m 755 gnulib $(libdir)/gcc-gnulib
  323.     if [ -f /usr/bin/ranlib ] ; then  ranlib $(libdir)/gcc-gnulib ;fi
  324.     install cpp $(libdir)/gcc-cpp
  325.     install gcc $(bindir)
  326.  
  327. # do make -f ../gcc/Makefile maketest DIR=../gcc
  328. # in the intended test directory to make it a suitable test directory.
  329. maketest:
  330.     ln -s $(DIR)/*.[chy] .
  331.     ln -s $(DIR)/*.def .
  332.     ln -s $(DIR)/*.md .
  333.     ln -s $(DIR)/.gdbinit .
  334.     -ln -s $(DIR)/bison.simple .
  335.     ln -s $(DIR)/gcc .
  336.     ln -s $(DIR)/move-if-change .
  337.     ln -s $(DIR)/Makefile test-Makefile
  338.     -rm tm.h aux-output.c
  339.     make -f test-Makefile clean
  340. # You must create the necessary links tm.h, md and aux-output.c
  341.  
  342. # Copy the object files from a particular stage into a subdirectory.
  343. stage1: force
  344.     -mkdir stage1
  345.     mv $(STAGESTUFF) $(STAGE_GCC) stage1
  346.     ln gnulib stage1
  347.  
  348. stage2: force
  349.     -mkdir stage2
  350.     mv $(STAGESTUFF) $(STAGE_GCC) stage2
  351.     ln gnulib stage2
  352.  
  353. stage3: force
  354.     -mkdir stage3
  355.     mv $(STAGESTUFF) $(STAGE_GCC) stage3
  356.     ln gnulib stage3
  357.  
  358. .PHONY: stage1 stage2 stage3 #In GNU Make, ignore whether `stage*' exists.
  359. force:
  360.  
  361. TAGS: force
  362.     etags *.y *.h *.c
  363. .PHONY: TAGS
  364.